<template>
  <div>
    <p>{{ num }}</p>
    <!-- 绑定add自定义事件 -->
    <A @add="add" />
  </div>
</template>

<script>
import A from "./components/A.vue";

export default {
  name: "App",
  data() {
    return {
      num: 0,
    };
  },
  methods: {
    add() {
      this.num++;
    },
  },
  components: {
    A,
  },
};
</script>

<style scoped>
</style>
